
module.exports = function () {
	var observerSet = [];
	var _self = this;

	this.addObserver = function (observer) {
		observerSet.push(observer);
	}

	this.removeObserver = function (observer) {
		var index = observerSet.indexOf(observer);
		if(index >= 0){
			observerSet.splice(index, 1);
		}
	}

	this.notifyAll = function () {
		for(var key in observerSet) {
			if(observerSet[key])
				observerSet[key].update();
		}
	}
}
